At present, many data transmission devices support a USB transmission function. When a USB device transmits data to another device, the peer device is required to provide a USB driver, for example, a mobile phone supporting a USB transmission function may transmit data to a personal computer (PC) by using the USB transmission function, where the PC is a primary device and the mobile phone is a secondary device. Because a USB driver can be installed on the PC according to a specific USB port type, the PC and the mobile phone can transmit data to each other normally.
A human interface device (HID) device is a device that can transmit data to a peer device without requiring the peer device to provide any driver. All HID devices establish relationships with applications on peer devices by using a built-in HID device driver. The peer devices may access the HID devices by calling an application layer interface. For example, a PC uses a keyboard, a mouse, and a joystick.
However, with development of transmission devices, devices supporting an On-The-Go (OTG) function start to emerge. OTG is mainly applicable to connections between different devices or mobile devices for data transmission. Most OTG devices can function as primary devices to support data transmission with HID devices functioning as secondary devices. In the prior art, however, most USB devices are non-HID USB devices functioning as secondary devices, and therefore cannot directly communicate with OTG devices.